package org.szw.jpademo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description
 * @Author 申紫微
 * @Data 2020-06-05 17:03:31
 * @Version 1.0
 */
@Slf4j
public class BaseController {

    public Integer pageNumber;
    public Integer pageSize;
    public Integer totalRow;

    Pageable page = PageRequest.of(pageNumber, pageSize);

    protected HttpServletRequest request;
    protected HttpServletResponse response;

    @ModelAttribute
    public void setRequestAndResopnse(HttpServletRequest request, HttpServletResponse response) {
        this.request = request;
        this.response = response;
    }

}
